package sf.md.create.factory.abstractt;

public class CarFactory extends FactoryAbstracy<CarEnum,Car>{

    @Override
    Car createOjbect(CarEnum carEnum) throws Exception {
       switch (carEnum){
           case BIGCAR:
               return new BigCar();
           case SMALLCAR:
               return  new SmallCar();
           default:
               throw new Exception("没有这种类型的汽车");
       }
    }
}
